]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/backgroundApps: Use ShellApp.activate_action() to quit apps
authorJulian Sparber <julian@sparber.net>
Mon, 19 Feb 2024 08:43:56 +0000 (09:43 +0100)
committerJulian Sparber <julian@sparber.net>
Wed, 28 Feb 2024 10:28:06 +0000 (11:28 +0100)
`ShellApp` gained the ability to activated actions, therefore drop the current
implementation in favor for it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3198>

js/ui/status/backgroundApps.js

index 6c4b80601afae3ae5da7e2d69b90c2e3b2e370b4..df9b4ab1c2de7090dd1373c6fed367c4f16722fc 100644 (file)
@@ -111,8 +111,6 @@ const BackgroundAppMenuItem = GObject.registerClass({
     }
 
     async _quitApp() {
-        const appId = this.app.get_id().replace(/\.desktop$/, '');
-
         this._spinner.play();
         this._spinnerTimeoutId =
             GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, SPINNER_TIMEOUT,
@@ -124,18 +122,10 @@ const BackgroundAppMenuItem = GObject.registerClass({
                 });
 
         try {
-            await Gio.DBus.session.call(
-                appId,
-                `/${appId.replaceAll('.', '/')}`,
-                'org.freedesktop.Application',
-                'ActivateAction',
-                new GLib.Variant('(sava{sv})', ['quit', [], {}]),
-                null,
-                Gio.DBusCallFlags.NONE,
-                -1,
-                null);
+            await this.app.activate_action('quit', null, 0, -1, null);
         } catch (_error) {
             try {
+                const appId = this.app.get_id().replace(/\.desktop$/, '');
                 Util.trySpawn(['flatpak', 'kill', appId]);
             } catch (pidError) {
                 logError(pidError, 'Failed to kill application');